/*
 * DxfAcisSatEntity.java
 *
 * Created on 6 de Dezembro de 2007, 10:53
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package importadorDXF;

import java.util.Vector;

/**
 *
 * @author rafaelbuck
 */
public class AcisSatEntity extends DxfEntity
{

    public boolean setGroup(short grpNr, int ival)
    {
        switch(grpNr)
        {
        case 70: // 'F'
            modelerFormatVersion = ival;
            return true;
        }
        return super.setGroup(grpNr, ival);
    }

    public boolean setGroup(short grpNr, String str)
    {
        switch(grpNr)
        {
        case 3: // '\003'
            int lastLine = proprietaryModelerDataLines.size() - 1;
            if(lastLine >= 0)
            {
                String last = (String)proprietaryModelerDataLines.elementAt(lastLine);
                proprietaryModelerDataLines.setElementAt(last + str, lastLine);
                return true;
            }
            // fall through

        case 1: // '\001'
            proprietaryModelerDataLines.addElement(str);
            return true;

        case 2: // '\002'
        default:
            return super.setGroup(grpNr, str);
        }
    }

    public int getModelerFormatVersion()
    {
        return modelerFormatVersion;
    }

    public String[] getProprietaryModelerDataLines()
    {
        String ret[] = new String[proprietaryModelerDataLines.size()];
        for(int i = ret.length - 1; i >= 0; i--)
            ret[i] = (String)proprietaryModelerDataLines.elementAt(i);

        return ret;
    }

    /** Creates a new instance of AcisSatEntity */
    public AcisSatEntity()
    {
        modelerFormatVersion = 1;
        proprietaryModelerDataLines = new Vector();
    }

    private int modelerFormatVersion;
    private Vector proprietaryModelerDataLines;
}